﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using myTwitter.BO;

namespace myTwitter.Sorting
{
    public class IMessageSortingOnDate : IComparer
    {
        #region IComparer Members

        public int Compare(object x, object y)
        {
            IMessage message1 = x as IMessage;
            IMessage message2 = y as IMessage;
            if (message1.CreatedAt < message2.CreatedAt)
                return 1;
            else if (message1.CreatedAt == message2.CreatedAt)
                return 0;
            else
                return -1;
        }

        #endregion
    }
}
